<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Brushes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="ButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle SnapsToDevicePixels="true" Stroke="{StaticResource PressedButtonOuterBackground}" StrokeDashArray="2 1" StrokeThickness="1" Margin="2" RadiusX="2" RadiusY="2"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SMToggleButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="Foreground" Value="{StaticResource ButtonForeground}"/>
        <Setter Property="Background" Value="{StaticResource ButtonOuterBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ButtonOuterBorder}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Background="White" CornerRadius="3">
                        <Border x:Name="OuterBorder" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3" BorderThickness="{TemplateBinding BorderThickness}">
                            <Border x:Name="InnerBorder" SnapsToDevicePixels="true" BorderBrush="{StaticResource ButtonInnerBorder}" Background="{StaticResource ButtonInnerBackground}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Border>
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" Value="{StaticResource HoverButtonOuterBackground}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource HoverButtonOuterBorder}"/>
                            <Setter Property="Background" TargetName="InnerBorder" Value="{StaticResource HoverButtonInnerBackground}"/>
                            <Setter Property="BorderBrush" TargetName="InnerBorder" Value="{StaticResource HoverButtonInnerBorder}"/>
                            <Setter Property="Foreground" Value="{StaticResource HoverButtonForeground}"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" Value="{StaticResource PressedButtonOuterBackground}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource PressedButtonOuterBorder}"/>
                            <Setter Property="Background" TargetName="InnerBorder" Value="{StaticResource PressedButtonInnerBackground}"/>
                            <Setter Property="BorderBrush" TargetName="InnerBorder" Value="{StaticResource PressedButtonInnerBorder}"/>
                            <Setter Property="BorderThickness" TargetName="InnerBorder" Value="0"/>
                            <Setter Property="Foreground" Value="{StaticResource PressedButtonForeground}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="{StaticResource DisabledButtonOuterBackground}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource DisabledButtonOuterBorder}"/>
                            <Setter Property="Background" TargetName="InnerBorder" Value="{StaticResource DisabledButtonInnerBackground}"/>
                            <Setter Property="BorderBrush" TargetName="InnerBorder" Value="{StaticResource DisabledButtonInnerBorder}"/>
                            <Setter Property="Foreground" Value="{StaticResource DisabledButtonForeground}"/>
                        </Trigger>

                        <Trigger Property="IsChecked" Value="true">
                            <Setter Property="Background" Value="{StaticResource PressedButtonOuterBackground}"/>
                            <Setter Property="BorderBrush" Value="{StaticResource PressedToggleButtonOuterBorder}"/>
                            <Setter Property="Background" TargetName="InnerBorder" Value="{StaticResource PressedButtonInnerBackground}"/>
                            <Setter Property="BorderBrush" TargetName="InnerBorder" Value="{StaticResource PressedButtonInnerBorder}"/>
                            <Setter Property="BorderThickness" TargetName="InnerBorder" Value="0"/>
                            <Setter Property="Foreground" Value="{StaticResource PressedButtonForeground}"/>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="SMRadioButtonStyle" BasedOn="{StaticResource SMToggleButton}" TargetType="{x:Type RadioButton}"/>


</ResourceDictionary>